package cn.edu.zafu.bigdata.x.zyy;

interface Movable {
    void move();
    void stop();
}
interface Resizable {
    void resize(double factor);
}
class Car1 implements Movable {
    public void move() {
        System.out.println("The car is moving.");
    }
    public void stop() {
        System.out.println("The car has stopped.");
    }
}

class ResizableCircle implements Movable, Resizable {
    private double radius;

    public ResizableCircle(double radius) {
        this.radius = radius;
    }

    public void move() {
        System.out.println("The circle is moving.");
    }
    public void stop() {
        System.out.println("The circle has stopped.");
    }


    public void resize(double factor) {
        radius *= factor;
        System.out.println("The circle's radius after resizing is: " + radius);
    }
}

public class TestInterface {
    public static void main(String[] args) {
        // 创建 Car 和 ResizableCircle 的实例
        Car1 car = new Car1();

        ResizableCircle resizableCircle = new ResizableCircle(5.0);

        // 验证每个类对接口方法的实现
        car.move();
        car.stop();

        resizableCircle.move();
        resizableCircle.stop();
        resizableCircle.resize(2.0); // 假设缩放因子为 2.0
    }
}
